
package com.compuvest.web;

// <editor-fold defaultstate="collapsed" desc="import">
import java.text.DecimalFormat;
import java.util.Date;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
// </editor-fold>

public class Mail implements java.io.Serializable {

// <editor-fold defaultstate="collapsed" desc="init">
    public static final Logger log = LoggerFactory.getLogger(Mail.class);

    private final static String VERSION = "Mail v5.0 2008-02-15";
    public final static String LINE = "\n**************************************************";

    public final static String CD_MESSAGE500 =
	"You have chosen Collect on Delivery (C.O.D.) as your payment method and we have a requirement for COD orders that "+
	"exceed $500.00 to be paid by Money Order and is subject for our credit department approval.\n" +
	"Our representative will contact you to verify the payment method.\nWe apologize for any inconvenience this may cause.\n";

    public final static String CD_MESSAGE100 =
	"You have chosen Collect on Delivery (C.O.D.) as your payment method and we have a requirement for COD orders that exceed $100.00 "+
	"to be paid by Cashiers Check or Money Order unless our credit department approved a Company Check payment prior to the purchase.\n" +
	"Our representative will contact you to verify the payment method.\nWe apologize for any inconvenience this may cause.\n";

    public final static String MESSAGE1 =
	"Please review your order information in case you need to make any changes. If you have any questions about your order, " +
	"please visit the http://www.compuvestb2b.com/info/CustomerService.jsp " +
	"section of the web site to get to the right department so that the issue was quickly resolved.\n" +
	"We hope you have had an excellent and rewarding experience shopping with us.\n" +
	"PLEASE CLICK HERE TO SHARE YOUR OPINION ON OUR SERVICES WITH https://eval.bizrate.com/popup.pl?id=21718 COMMUNITY.\n\n";

    public final static String POLICY =
	"\n\nOrder Acceptance Policy:\n" +
	"Your submission of an order and/or receipt of an order confirmation, automated or otherwise, does not signify our acceptance " +
	"of such order. CompuVest reserves the right to cancel any order that we deem necessary, at our sole discretion, regardless of " +
	"the order status or whether you have received a confirmation of the order. We reserve the right to require additional " +
	"information from you before accepting or processing any order.\n\n";

    public final static String BUTTOM =
	"Thank you\n" +
	"CompuVest Corp.\n" +
	"Phone: (425) 738-4091\n" +
	"Fax  : (425) 251-5000\n" +
	"info@compuvest.com\n" +
	"www.compuvestb2b.com\n\n";

    public final static String resMessage =
	"Thank you for your interest in our reseller program.  Your application has been submitted and will be reviewed by one of our " +
	"account managers.  We will be contacting you within 24 hours if any questions arise and will help you take full advantage of " +
	"this program. You will also be assigned a designated sales person to work directly with your company - ensuring everything " +
	"is  handled smoothly and accurately.\nIf you have applied for Net terms or COD, qualification may take longer - depending " +
	"on how fast your bank and trades respond.\n" +
        "For resellers who would like to apply for COD or NET terms, please fill out the application form http://www.compuvestb2b.com/images/form/reseller.rtf " +
        "and fax to (425) 251-5000.\n\n\n" +
	"We appreciate your business!\n\n" +
	"Sales Team\nCompuvestb2b.com reseller division\n" +
	"3600 Lind Ave SW, suite 130\n" +
	"Renton, WA 98057\n" +
	"Tel: (425) 738-4091\n" +
	"Fax: (425) 251-5000\n" +
	"b2b@compuvest.com\n" +
	"www.compuvestb2b.com\n";

    public static final String mailbodyLostCustomer =
	"You recently registered on CompuVestb2b.com. However you did not complete your purchase.\n" +
	"Did this happen due to:\n\n" +
	"a. Technical issues on the web site or\n" +
	"b. You simply decided not to make a purchase for other reasons.\n\n" +
	"Please note that this is just a survey - we are not trying to sell you\n" +
	"anything or solicit you in any way.\n" +
	"We would appreciate your feedback on this issue. Your opinion will help\n" +
	"us to serve our customers with the highest standards.\n\n" +
	"Thank you,\n\n" +
	"Megan\n" +
	"Customer Satisfaction Manager\n" +
	"Compuvestb2b.com\n" +
	"Tel: 425-738-4091 Ext 136\n" +
	"megan@compuvest.com\n";

    private DecimalFormat priceDF;

    private GoogleEmail gmail;
// </editor-fold>

// <editor-fold defaultstate="collapsed" desc="Mail()">

    public Mail() {

        gmail = new GoogleEmail();

        priceDF = new DecimalFormat("$#,##0.00");

        log.info("Init: " + VERSION);
    }
// </editor-fold>

// <editor-fold defaultstate="collapsed" desc="sendEmail()">

    public void sendEmail(Basket basket) {

	sendToCompany(basket);
	sendToOlga(basket);
	sendToCustomer(basket);
    }
// </editor-fold>

// <editor-fold defaultstate="collapsed" desc="sendReseller()">

    public void sendReseller(Customer cust) {

	toReseller(cust);
	toCompany(cust);
    }
// </editor-fold>

// <editor-fold defaultstate="collapsed" desc="sendToOlga()">

    public void sendToOlga(Basket basket) {

        Customer cust = basket.getCustomer();
        StringBuilder subject = new StringBuilder(100);
        StringBuilder body = new StringBuilder(10000);
        StringBuilder shipBody = new StringBuilder(1000);

        subject.append(" -=Reseller=- ").append("Order From Compuvestb2b.com #").append(basket.getOrderNumber());

        body.append("Confirmation Number: ").append(basket.getOrderNumber());
        body.append(" -=Reseller=- ").append(basket.getBlindShipping() ? "-=Blind=-" : "");
        body.append("\n\nItemNo\t\tQty\tPrice\t\tAmount\tItem Name");

        for (ItemsInBasket item : basket.getContents()) {
            body.append("\n").append(item.getAccwareCode());
            body.append("\t").append(item.getTotalQuantity());
            body.append("\t").append(priceDF.format(item.getSellPrice()));
            body.append("\t").append(priceDF.format(item.getTotalQuantity() * item.getSellPrice()));
            body.append("\t").append(item.getItemName());

            if (item.getWarrantyPrice() != 0D) {
                body.append("\n***warranty:\t").append(item.getWarrantyDesc()).append("\t");
                body.append(priceDF.format(item.getWarrantyTotal())).append(" for #").append(item.getAccwareCode());
            }
        }
        body.append("\nTotal Amount:\t\t").append(priceDF.format(basket.getTotal()));

        shipBody.append("\n\nShip Company:\t\t").append(cust.shipping.getCompany());
        shipBody.append("\nShip Name:\t\t\t").append(cust.shipping.getName());
        shipBody.append("\nShip Address:\t\t").append(cust.shipping.getAddress1()).append(" ").append(cust.shipping.getAddress2());
        shipBody.append("\n\t\t\t\t").append(cust.shipping.getZip()).append(" ").append(cust.shipping.getZip4());
        shipBody.append(" ").append(cust.shipping.getCity()).append(", ").append(cust.shipping.getState());
        shipBody.append(" ").append(cust.shipping.getCountry());
        shipBody.append("\nShip Phone:\t\t\t").append(cust.shipping.getPhone());
        if (cust.shipping.hasCell()) {
            shipBody.append("\nShip Cell:\t\t\t").append(cust.shipping.getCell());
        }
        if (cust.shipping.hasFax()) {
            shipBody.append("\nShip Fax:\t\t\t").append(cust.shipping.getFax());
        }
        shipBody.append("\nEmail:\t\t\t").append(cust.getEmail());

        body.append("\n\nShipping:\t\t\t").append(priceDF.format(basket.getShippingCost())).append(" ").append(basket.getShippingDescription());

        switch (basket.getPaymentMethod()) {
            case "CD":
                subject.append(" C.O.D");
                body.append("\n\nOrder Total:\t\t\t").append(priceDF.format(basket.getGrandTotal()));
                body.append(shipBody);
                break;
            case "GG":
                subject.append(" Google");
                body.append("\n\nOrder Total:\t\t\t").append(priceDF.format(basket.getGrandTotal()));
                body.append(shipBody);
                body.append("\nPayment Method:\t\tGOOGLE");
                break;
            case "PP":
                subject.append(" PayPal");
                body.append("\n\nOrder Total:\t\t\t").append(priceDF.format(basket.getGrandTotal()));
                body.append(shipBody);
                body.append("\nPayment Method:\t\tPAYPAL");
                break;
            default:
                // not C.O.D, ED, WT, UN
                subject.append(" ").append(basket.getPaymentMethod());
                body.append("\n\nOrder Total:\t\t\t").append(priceDF.format(basket.getGrandTotal()));
                body.append(shipBody);
                body.append("\n\nName on CC:\t\t").append(cust.getCName());
                body.append("\nBilling Company:\t\t").append(cust.billing.getCompany());
                body.append("\nBilling name:\t\t").append(cust.billing.getName());
                body.append("\nBilling Address:\t\t").append(cust.billing.getAddress1()).append(" ").append(cust.billing.getAddress2());
                body.append("\n\t\t\t\t").append(cust.billing.getZip()).append(" ").append(cust.billing.getZip4());
                body.append(" ").append(cust.billing.getCity()).append(", ").append(cust.billing.getState());
                body.append(" ").append(cust.billing.getCountry());
                body.append("\nBilling Phone:\t\t").append(cust.billing.getPhone());
                if (cust.billing.hasCell()) {
                    body.append("\nBilling Cell:\t\t\t").append(cust.billing.getCell());
                }
                if (cust.billing.hasFax()) {
                    body.append("\nBilling Fax:\t\t\t").append(cust.billing.getFax());
                }
                if (basket.getNotes().trim().length() != 0) {
                    body.append("\nNotes:\t\t").append(basket.getNotes());
                }
                if (cust.getShippingAccount().length() != 0) {
                    body.append("\nUse Cust Acc#:\t").append(cust.getShippingAccount());
                }
                body.append("\n\nCC Number:\t\t").append(cust.getCardNumber());
                body.append("\nCC Exp. Date:\t\t").append(cust.getCExpDate());
                body.append("\nCC Type:\t\t\t").append(cust.getCType());
                body.append("\nCC Verify Number:\t").append(cust.getCNumberAdd());
                body.append("\nBank Phone:\t\t").append(cust.getBankPhone());
        }

        gmail.send(
            "webinfo@compuvest.com",
            new String[] { "olechka@compuvest.com" },
            subject.toString(),
            body.toString(),
            "text/plain"
        );

    }
// </editor-fold>

// <editor-fold defaultstate="collapsed" desc="sendToCompany()">

    public void sendToCompany(Basket basket) {

        Customer cust = basket.getCustomer();
        StringBuilder subject = new StringBuilder(100);
        StringBuilder body = new StringBuilder(10000);
        StringBuilder shipBody = new StringBuilder(1000);

        subject.append(" -=Reseller=- ");

        body.append("\nConfirmation Number: <b>").append(basket.getOrderNumber());
        body.append(" -=Reseller=- ").append(basket.getBlindShipping() ? "-=Blind=-" : "").append("</b>");

        body.append("<table width=100% border=1>");
        body.append("<tr><th>ItemNo</th><th>Qty</th><th>Price</th><th>Amount</th><th>Item Name</th></tr>");

        for (ItemsInBasket item : basket.getContents()) {
            body.append("<tr>");
            body.append("<td>").append(item.getAccwareCode()).append("</td>");
            body.append("<td>").append(item.getTotalQuantity()).append("</td>");
            body.append("<td>").append(priceDF.format(item.getSellPrice())).append("</td>");
            body.append("<td>").append(priceDF.format(item.getTotalQuantity() * item.getSellPrice())).append("</td>");
            body.append("<td>").append(item.getItemName()).append("</td>");
            body.append("</tr>");

            if (item.getWarrantyPrice() != 0d) {
                body.append("<tr>");
                body.append("<td colspan=5>Extended warranty: ").append(item.getWarrantyDesc()).append(" ");
                body.append(priceDF.format(item.getWarrantyTotal())).append(" for #").append(item.getAccwareCode()).append("</td>");
                body.append("</tr>");
            }
        }
        body.append("</table>");

        shipBody.append("<tr><td colspan=2><hr></td></tr>");
        shipBody.append("<tr><td>Ship Company:</td><td><b>").append(cust.shipping.getCompany()).append("</b></td></tr>");
        shipBody.append("<tr><td>Ship Name:</td><td><b>").append(cust.shipping.getName()).append("</b></td></tr>");
        shipBody.append("<tr><td>Ship Address:</td><td><b>").append(cust.shipping.getAddress1()).append(" ").append(cust.shipping.getAddress2()).append("</b></td></tr>");
        shipBody.append("<tr><td></td><td><b>").append(cust.shipping.getZip()).append(" ").append(cust.shipping.getZip4());
        shipBody.append(" ").append(cust.shipping.getCity()).append(", ").append(cust.shipping.getState());
        shipBody.append(" ").append(cust.shipping.getCountry()).append("</b></td></tr>");
        shipBody.append("<tr><td>Ship Phone:</td><td><b>").append(cust.shipping.getPhone()).append("</b></td></tr>");
        if (cust.shipping.hasCell()) {
            shipBody.append("<tr><td>Ship Cell:</td><td><b>").append(cust.shipping.getCell()).append("</b></td></tr>");
        }
        if (cust.shipping.hasFax()) {
            shipBody.append("<tr><td>Ship Fax:</td><td><b>").append(cust.shipping.getFax()).append("</b></td></tr>");
        }
        body.append("<tr><td>Email:</td><td><b>").append(cust.getEmail()).append("</b></td></tr>");


        body.append("<table border=0>");
        body.append("<tr><td>Shipping: ").append(basket.getShippingDescription()).append(":</td><td><b>").append(priceDF.format(basket.getShippingCost())).append("</b></td></tr>");

        switch (basket.getPaymentMethod()) {
            case "CD":
                subject.append("C.O.D order From Compuvestb2b.com ").append(basket.getOrderNumber());
                body.append("<tr><td>Total Amount:</td><td><b>").append(priceDF.format(basket.getGrandTotal())).append("</b></td></tr>");
                body.append(shipBody);
                body.append("</table>");
                break;
            case "GG":
                subject.append("Google order From Compuvestb2b.com ").append(basket.getOrderNumber());
                body.append("<tr><td>Total Amount:</td><td><b>").append(priceDF.format(basket.getGrandTotal())).append("</b></td></tr>");
                body.append(shipBody);
                body.append("<tr><td>Payment Method:</td><td><b>Google</b></td></tr>");
                body.append("</table>");
                break;
            case "PP":
                subject.append("PayPal order From Compuvestb2b.com ").append(basket.getOrderNumber());
                body.append("<tr><td>Total Amount:</td><td><b>").append(priceDF.format(basket.getGrandTotal())).append("</b></td></tr>");
                body.append(shipBody);
                body.append("<tr><td>Payment Method:</td><td><b>PayPal</b></td></tr>");
                body.append("</table>");
                break;
            default:
                // not C.O.D
                subject.append(basket.getPaymentMethod()).append("Order From Compuvestb2b.com ").append(basket.getOrderNumber());
                body.append("<tr><td>Total Amount:</td><td><b>").append(priceDF.format(basket.getGrandTotal())).append("</b></td></tr>");
                body.append(shipBody);
                body.append("<tr><td colspan=2><hr></td></tr>");
                body.append("<tr><td>Name on CC:</td><td><b>").append(cust.getCName()).append("</b></td></tr>");
                body.append("<tr><td>Billing Company:</td><td><b>").append(cust.billing.getCompany()).append("</b></td></tr>");
                body.append("<tr><td>Billing name:</td><td><b>").append(cust.billing.getName()).append("</b></td></tr>");
                body.append("<tr><td>Billing Address:</td><td><b>").append(cust.billing.getAddress1()).append(" ").append(cust.billing.getAddress2()).append("</b></td></tr>");
                body.append("<tr><td></td><td><b>").append(cust.billing.getZip()).append(" ").append(cust.billing.getZip4());
                body.append(" ").append(cust.billing.getCity()).append(", ").append(cust.billing.getState());
                body.append(" ").append(cust.billing.getCountry()).append("</b></td></tr>");
                body.append("<tr><td>Billing Phone:</td><td><b>").append(cust.billing.getPhone()).append("</b></td></tr>");
                if (cust.billing.hasCell()) {
                    body.append("<tr><td>Billing Cell:</td><td><b>").append(cust.billing.getCell()).append("</b></td></tr>");
                }
                if (cust.billing.hasFax()) {
                    body.append("<tr><td>Billing Fax:</td><td><b>").append(cust.billing.getFax()).append("</b></td></tr>");
                }
                if (basket.getNotes().trim().length() == 0) {
                    body.append("\n");
                }
                else {
                    body.append("<tr><td>Notes:</td><td>").append(basket.getNotes()).append("</td></tr>");
                }
                body.append("<tr><td>CC Exp. Date:</td><td><b>").append(cust.getCExpDate()).append("</b></td></tr>");
                body.append("<tr><td>CC Type:</td><td><b>").append(cust.getCType()).append("</b></td></tr>");
                body.append("<tr><td>Bank Phone:</td><td><b>").append(cust.getBankPhone()).append("</b></td></tr>");
                body.append("</table>");
        }

        gmail.send(
            "webinfo@compuvest.com",
            new String[] { "orderinfo@compuvest.com" },
            subject.toString(),
            body.toString(),
            "text/html"
        );
    }
// </editor-fold>

// <editor-fold defaultstate="collapsed" desc="sendToCustomer()">

    public void sendToCustomer(Basket basket) {

        Customer cust = basket.getCustomer();

        StringBuilder subject = new StringBuilder(100);
        StringBuilder body = new StringBuilder(10000);
        StringBuilder shipBody = new StringBuilder(1000);

        subject.append("Reseller ").append("Order from www.compuvestb2b.com #").append(basket.getOrderNumber());

        body.append("\nDear ").append(cust.billing.getName()).append(",\n\n");
        body.append("This message is to inform you that we have received your on-line order and that your order is currently in process.\n");

        if ("CD".equals(basket.getPaymentMethod()) && (basket.getGrandTotal() > 500.0)) {
            body.append(CD_MESSAGE500);
        }
        else if ("CD".equals(basket.getPaymentMethod()) && (basket.getGrandTotal() > 100.0)) {
            body.append(CD_MESSAGE100);
        }
        body.append(MESSAGE1);

        body.append("Confirmation Number: ").append(basket.getOrderNumber());
        body.append(" Reseller ").append(basket.getBlindShipping() ? " Blind Shipping" : "");
        body.append(LINE);
        body.append("\nItemNo\t\tQty\tPrice\tAmount\tItem Name\tCondition\n");

        for (ItemsInBasket item : basket.getContents()) {
            body.append(item.getAccwareCode()).append("\t");
            body.append(item.getTotalQuantity()).append("\t");
            body.append(priceDF.format(item.getSellPrice())).append("\t");
            body.append(priceDF.format(item.getTotalQuantity() * item.getSellPrice())).append("\t");
            body.append(item.getItemName()).append("\t");
            body.append("***").append(item.getCondition()).append("***\n");

            if (item.getWarrantyPrice() != 0D) {
                body.append("Ext. Warranty\t").append(item.getWarrantyDesc()).append("\t");
                body.append(priceDF.format(item.getWarrantyTotal())).append(" for #").append(item.getAccwareCode()).append("\n");
            }
        }
        body.append(LINE);
        body.append("\nTotal Amount: ").append(priceDF.format(basket.getTotal()));

        shipBody.append(LINE);
        shipBody.append("\nShipping:  ");
        shipBody.append("\n").append(cust.shipping.getCompany());
        shipBody.append("\n").append(cust.shipping.getName());
        shipBody.append("\n").append(cust.shipping.getAddress1()).append(" ").append(cust.shipping.getAddress2());
        shipBody.append("\n").append(cust.shipping.getCity()).append(", ").append(cust.shipping.getState());
        shipBody.append(" ").append(cust.shipping.getZip()).append(" ").append(cust.shipping.getZip4());
        shipBody.append(" ").append(cust.shipping.getCountry());
        shipBody.append("\nPhone:    ").append(cust.shipping.getPhone());
        if (cust.shipping.hasCell()) {
            shipBody.append("\nCell :    ").append(cust.shipping.getCell());
        }
        if (cust.shipping.hasFax()) {
            shipBody.append("\nFax:      ").append(cust.shipping.getFax());
        }

        body.append("\nShipping:     ").append(priceDF.format(basket.getShippingCost())).append(" (").append(basket.getShippingDescription()).append(")");

        switch (basket.getPaymentMethod()) {
            case "CD":
                subject.append(" C.O.D");
                body.append("\nOrder Total:  ").append(priceDF.format(basket.getGrandTotal()));
                body.append(shipBody);
                break;
            case "GG":
                subject.append(" Google");
                body.append("\nOrder Total:  ").append(priceDF.format(basket.getGrandTotal()));
                body.append(shipBody);
                break;
            case "PP":
                subject.append(" PayPal");
                body.append("\nOrder Total:  ").append(priceDF.format(basket.getGrandTotal()));
                body.append(shipBody);
                break;
            default:
                // regular no C.O.D
                body.append("\nOrder Total:  ").append(priceDF.format(basket.getGrandTotal()));
                body.append(shipBody);
                body.append(LINE);
                body.append("\nBilling Address:");
                body.append("\n").append(cust.billing.getCompany());
                body.append("\n").append(cust.billing.getAddress1()).append(" ").append(cust.billing.getAddress2());
                body.append("\n").append(cust.billing.getCity()).append(", ").append(cust.billing.getState());
                body.append(" ").append(cust.billing.getZip()).append(" ").append(cust.billing.getZip4());
                body.append(" ").append(cust.billing.getCountry());
        }

        body.append(POLICY);
        body.append(BUTTOM);

        gmail.send(
            "webinfo@compuvest.com",
            new String[] { cust.getEmail() },
            subject.toString(),
            body.toString(),
            "text/plain"
        );
    }
// </editor-fold>

// <editor-fold defaultstate="collapsed" desc="sendPassword()">

    public void sendPassword(Customer cust) {

        StringBuilder body = new StringBuilder();
        body.append("\nDear ").append(cust.billing.getName()).append(",\n\n");
        body.append("Your password is: \'").append(cust.getPassword()).append("\'\n\n");
        body.append("If you still experiencing technical problems\n");
        body.append("please contact our customer service department.\n\n\n");
        body.append(BUTTOM);

        gmail.send(
            "webinfo@compuvest.com",
            new String[] { cust.getEmail() },
            "Password request from Compuvestb2b.com " + new java.util.Date(),
            body.toString(),
            "text/plain"
        );

    }
// </editor-fold>

// <editor-fold defaultstate="collapsed" desc="toCompany()">

    public void toCompany(Customer cust) {

        StringBuilder body = new StringBuilder(600);
        body.append("\nNew reseller").append("\n\n");
        body.append("\nResseler Code:\t").append(cust.getResellerCode());
        body.append("\nEmail:\t\t").append(cust.getEmail()).append("\n");
        body.append("\nBilling Company:\t").append(cust.billing.getCompany());
        body.append("\nName:\t\t").append(cust.billing.getName());
        body.append("\nAddress:\t").append(cust.billing.getAddress1());
        body.append("\nCity:\t\t").append(cust.billing.getCity());
        body.append("\nState:\t").append(cust.billing.getState());
        body.append("\nZip:\t\t").append(cust.billing.getZip());
        body.append("\nCountry:\t").append(cust.billing.getCountry());
        body.append("\nPhone:\t").append(cust.billing.getPhone());
        body.append("\nCell:\t\t").append(cust.billing.getCell());
        body.append("\nFax:\t\t").append(cust.billing.getFax());
        body.append("\n\nHear about us:\t").append(cust.getHearAboutUs());
        body.append("\n\n");

        gmail.send(
            "webinfo@compuvest.com",
            new String[] { "b2b@compuvest.com" },
            "Registrated Reseller from Compuvestb2b.com " + new java.util.Date(),
            body.toString(),
            "text/plain"
        );
    }
// </editor-fold>

// <editor-fold defaultstate="collapsed" desc="toReseller()">

    public void toReseller(Customer cust) {

        StringBuilder body = new StringBuilder();
        body.append("\nDear ").append(cust.billing.getName()).append(",\n\n");
        body.append(resMessage);

        gmail.send(
            "webinfo@compuvest.com",
            new String[] { "b2b@compuvest.com" },
            "Registration Reseller request from Compuvestb2b.com " + new Date(),
            body.toString(),
            "text/plain"
        );

    }
// </editor-fold>

// <editor-fold defaultstate="collapsed" desc="sendEmailToLostCustomer()">

    public void sendEmailToLostCustomer(String email) {

        gmail.send(
            "webinfo@compuvest.com",
            new String[] { email },
            "Compuvest Corp. " + new Date(),
            mailbodyLostCustomer,
            "text/plain"
        );

    }
// </editor-fold>

}
